.class public abstract Lorg/microemu/android/device/ui/AndroidDisplayableUI;
.super Ljava/lang/Object;
.source "AndroidDisplayableUI.java"

# interfaces
.implements Lorg/microemu/device/ui/DisplayableUI;


# static fields
.field private static commandsPriorityComparator:Ljava/util/Comparator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Comparator",
            "<",
            "Lorg/microemu/device/ui/CommandUI;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field protected activity:Lorg/microemu/android/MicroEmulatorActivity;

.field private commandListener:Ljavax/microedition/lcdui/CommandListener;

.field private commands:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Lorg/microemu/android/device/ui/AndroidCommandUI;",
            ">;"
        }
    .end annotation
.end field

.field protected displayable:Ljavax/microedition/lcdui/Displayable;

.field protected titleView:Landroid/widget/TextView;

.field protected view:Landroid/view/View;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 53
    new-instance v0, Lorg/microemu/android/device/ui/AndroidDisplayableUI$1;

    invoke-direct {v0}, Lorg/microemu/android/device/ui/AndroidDisplayableUI$1;-><init>()V

    sput-object v0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commandsPriorityComparator:Ljava/util/Comparator;

    return-void
.end method

.method protected constructor <init>(Lorg/microemu/android/MicroEmulatorActivity;Ljavax/microedition/lcdui/Displayable;)V
    .locals 1
    .parameter "activity"
    .parameter "displayable"

    .prologue
    .line 71
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 67
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    iput-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commands:Ljava/util/Vector;

    .line 69
    const/4 v0, 0x0

    iput-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commandListener:Ljavax/microedition/lcdui/CommandListener;

    .line 72
    iput-object p1, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->activity:Lorg/microemu/android/MicroEmulatorActivity;

    .line 73
    iput-object p2, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->displayable:Ljavax/microedition/lcdui/Displayable;

    .line 74
    return-void
.end method


# virtual methods
.method public addCommandUI(Lorg/microemu/device/ui/CommandUI;)V
    .locals 2
    .parameter "cmd"

    .prologue
    .line 89
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commands:Ljava/util/Vector;

    check-cast p1, Lorg/microemu/android/device/ui/AndroidCommandUI;

    .end local p1
    invoke-virtual {v0, p1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 91
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commands:Ljava/util/Vector;

    sget-object v1, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commandsPriorityComparator:Ljava/util/Comparator;

    invoke-static {v0, v1}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V

    .line 92
    return-void
.end method

.method public getCommandListener()Ljavax/microedition/lcdui/CommandListener;
    .locals 1

    .prologue
    .line 81
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commandListener:Ljavax/microedition/lcdui/CommandListener;

    return-object v0
.end method

.method public getCommands()Ljava/util/Vector;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Vector",
            "<",
            "Lorg/microemu/android/device/ui/AndroidCommandUI;",
            ">;"
        }
    .end annotation

    .prologue
    .line 121
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commands:Ljava/util/Vector;

    return-object v0
.end method

.method public getCommandsUI()Ljava/util/Vector;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Vector",
            "<",
            "Lorg/microemu/android/device/ui/AndroidCommandUI;",
            ">;"
        }
    .end annotation

    .prologue
    .line 77
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commands:Ljava/util/Vector;

    return-object v0
.end method

.method public final hideNotify()V
    .locals 0

    .prologue
    .line 118
    return-void
.end method

.method public invalidate()V
    .locals 2

    .prologue
    .line 103
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->titleView:Landroid/widget/TextView;

    if-eqz v0, :cond_0

    .line 104
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->titleView:Landroid/widget/TextView;

    iget-object v1, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->displayable:Ljavax/microedition/lcdui/Displayable;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/Displayable;->getTitle()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 106
    :cond_0
    return-void
.end method

.method public removeCommandUI(Lorg/microemu/device/ui/CommandUI;)V
    .locals 1
    .parameter "cmd"

    .prologue
    .line 95
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commands:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->remove(Ljava/lang/Object;)Z

    .line 96
    return-void
.end method

.method public setCommandListener(Ljavax/microedition/lcdui/CommandListener;)V
    .locals 0
    .parameter "l"

    .prologue
    .line 99
    iput-object p1, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->commandListener:Ljavax/microedition/lcdui/CommandListener;

    .line 100
    return-void
.end method

.method public final showNotify()V
    .locals 2

    .prologue
    .line 109
    iget-object v0, p0, Lorg/microemu/android/device/ui/AndroidDisplayableUI;->activity:Lorg/microemu/android/MicroEmulatorActivity;

    new-instance v1, Lorg/microemu/android/device/ui/AndroidDisplayableUI$2;

    invoke-direct {v1, p0}, Lorg/microemu/android/device/ui/AndroidDisplayableUI$2;-><init>(Lorg/microemu/android/device/ui/AndroidDisplayableUI;)V

    invoke-virtual {v0, v1}, Lorg/microemu/android/MicroEmulatorActivity;->post(Ljava/lang/Runnable;)Z

    .line 115
    return-void
.end method
